<%@page language="Java" contentType="text/html; UTF-8"
pageEncoding="UTF-8"%>
<%@taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<%@taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="ssi.tools.Connector" %>
<%@ page import="ssi.beans.User" %>

<%
	User user=(User)session.getAttribute("user");
	Connection connection = new Connector().getConnection();
	Statement statement = connection.createStatement();
	ResultSet result = statement.executeQuery("SELECT email FROM users where email <>'"+user.getEmail()+"'");
	int numberOfRows = Connector.getRowCount(result);
%>

<h2>Usun Uzytkownika</h2>
	<html:form action="deleteUser"> 
	
		<h3>Wybierz usera:</h3><br>
				<select name="email" id="email">
				<%
				int i = 0;
				while(result.next()){%>
				<option number="<%=i %>"><%=result.getString("email")%></option>
				
			<% }%>
			</select>
				<input type="submit" id="submit" class="submit" value="Usun" /><br>
				<font color="green"><html:errors property="info" /></font>
	</html:form>
